<admintpl file="headerEx" />
<title>后台中心登陆 {:L('ADMIN_CENTER')}</title>
<!--responsive table-->
<link href="__PUBLIC__/TciocEx/css/table-responsive.css" rel="stylesheet" />
<link href="__PUBLIC__/js/artDialog/skins/default.css" rel="stylesheet" />
<!--responsive table-->
<link href="__PUBLIC__/TciocEx/css/table-responsive.css" rel="stylesheet"/>
<!--ios7-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/TciocEx/js/ios-switch/switchery.css" />

<!--icheck-->
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/minimal.css" rel="stylesheet">
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/red.css" rel="stylesheet">
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/green.css" rel="stylesheet">
<style>
	.form-signin input[type="text"], .form-signin input[type="password"] {
		font-size: 18px;
	}
</style>
<script>
	if (window.parent !== window.self) {
		document.write = '';
		window.parent.location.href = window.self.location.href;
		setTimeout(function () {
			document.body.innerHTML = '';
		}, 0);
	}
</script>
</head>

<!-- Placed js at the end of the document so the pages load faster -->
<body class="login-body">

<div class="container">
	<form method="post" name="login" action="{:U('public/dologin')}" autoComplete="off" class="form-signin js-ajax-form text-center">
		<div class="form-signin-heading text-center"  style="padding-bottom: 0px">
			<h1  class="sign-title" style="text-align: center;">
				<a href="__ROOT__" style="background: url('') no-repeat center center;text-indent: 0; color: #ffffff;font-size: 1.7rem;font-weight: bold;text-decoration: none;">{:get_site_options()['site_name']} {:L('ADMIN_CENTER')}</a>
			</h1>
			<php>$logo=sp_getslide("logo"); </php>
			<if condition="empty($logo)">
				<img  style="text-align: center;max-width: 180px; max-height: 80px;"   src="__TMPL__Public/assets/images/logo_text.jpg">
				<else/>
				<img style="text-align: center;max-width: 180px; max-height: 80px;" src="{:sp_get_asset_upload_path($logo[0]['slide_pic'])}" alt="">
			</if>


			<!--<h1 class="sign-title">Sign In</h1>-->
			<!--<img src="images/login-logo.png" alt=""/>-->
		</div>
		<div class="login-wrap" >
			<input class="input form-control" id="js-admin-name" name="username" type="text" placeholder="{:L('USERNAME_OR_EMAIL')}" title="{:L('USERNAME_OR_EMAIL')}" value="{:cookie('admin_username')}" data-rule-required="true"  required=""   data-msg-required=""/>
			<!--<input type="text" class="form-control" placeholder="User ID" autofocus>-->
			<input class="input form-control" id="admin_pwd" type="password" name="password" placeholder="{:L('PASSWORD')}" title="{:L('PASSWORD')}" data-rule-required="true"  data-msg-required="" required="" />
			<!--<input type="password" class="form-control" placeholder="Password">-->
			<input class="input form-control" type="text" name="verify" required=""  placeholder="{:L('ENTER_VERIFY_CODE')}" />
			<div class="form-control" style="border: 0px">
				{:sp_verifycode_img('length=4&font_size=20&height=42&use_noise=1&use_curve=0','style="cursor: pointer;" title="点击获取"')}
			</div >

			<button class="btn btn-lg btn-login btn-block js-ajax-submit" type="submit">
				<i class="fa fa-check">{:L('LOGIN')}</i>
			</button>

			<!--<div class="registration">-->
				<!--Not a member yet?-->
				<!--<a class="" href="registration.html">-->
					<!--Signup-->
				<!--</a>-->
			<!--</div>-->
			<!--<label class="checkbox">-->
				<!--<input type="checkbox" value="remember-me"> Remember me-->
                <!--<span class="pull-right">-->
                    <!--<a data-toggle="modal" href="#myModal"> Forgot Password?</a>-->

                <!--</span>-->
			<!--</label>-->

		</div>

		<!-- Modal -->
		<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h4 class="modal-title">Forgot Password ?</h4>
					</div>
					<div class="modal-body">
						<p>Enter your e-mail address below to reset your password.</p>
						<input type="text" name="email" placeholder="Email" autocomplete="off" class="form-control placeholder-no-fix">

					</div>
					<div class="modal-footer">
						<button data-dismiss="modal" class="btn btn-default " type="button">Cancel</button>
						<button class="btn btn-primary" type="button">Submit</button>
					</div>
				</div>
			</div>
		</div>
		<!-- modal -->

	</form>

</div>
<div style="width:100%;position:fixed;bottom: 2px;left:0;">
	<footer>
		<admintpl file="copyright" />
	</footer>
</div>

<script>
	var GV = {
		ROOT: "__ROOT__/",
		WEB_ROOT: "__WEB_ROOT__/",
		JS_ROOT: "public/js/"
	};
</script>

<script src="__PUBLIC__/TciocEx/js/jquery-1.10.2.min.js"></script>

<script src="__PUBLIC__/js/wind.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="__PUBLIC__/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-migrate-1.2.1.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/modernizr.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/js/ajaxForm.js"></script>
<script src="__PUBLIC__/js/select2/select2.full.min.js"></script>


<script type="text/javascript" src="__PUBLIC__/TciocEx/js/jquery.validate.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-localization/messages_zh.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/scripts.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-init.js"></script>

<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>

<script type="text/javascript">
	$("#e9").select2({
		tags:true,
		allowClear:true,
		placeholder:"请点击选择文章分类"
	});
	$(function() {
		$(".js-ajax-close-btn").on('click', function(e) {
			e.preventDefault();
			Wind.use("artDialog", function() {
				art.dialog({
					id : "question",
					icon : "question",
					fixed : true,
					lock : true,
					background : "#CCCCCC",
					opacity : 0,
					content : "您确定需要关闭当前页面嘛？",
					ok : function() {
						setCookie("refersh_time", 1);
						window.close();
						return true;
					}
				});
			});
		});
		/////---------------------
		Wind.use('validate', 'ajaxForm', 'artDialog', function() {
			//javascript

			//编辑器
			editorcontent = new baidu.editor.ui.Editor();
			editorcontent.render('content');
			try {
				editorcontent.sync();
			} catch (err) {
			}
			//增加编辑器验证规则
			jQuery.validator.addMethod('editorcontent', function() {
				try {
					editorcontent.sync();
				} catch (err) {
				}
				return editorcontent.hasContents();
			});
			var form = $('form.js-ajax-forms');
			//ie处理placeholder提交问题
			if ($.browser && $.browser.msie) {
				form.find('[placeholder]').each(function() {
					var input = $(this);
					if (input.val() == input.attr('placeholder')) {
						input.val('');
					}
				});
			}

			var formloading = false;
			//表单验证开始
			form.validate({
				//是否在获取焦点时验证
				onfocusout : false,
				//是否在敲击键盘时验证
				onkeyup : false,
				//当鼠标掉级时验证
				onclick : false,
				//验证错误
				showErrors : function(errorMap, errorArr) {
					//errorMap {'name':'错误信息'}
					//errorArr [{'message':'错误信息',element:({})}]
					try {
						$(errorArr[0].element).focus();
						art.dialog({
							id : 'error',
							icon : 'error',
							lock : true,
							fixed : true,
							background : "#CCCCCC",
							opacity : 0,
							content : errorArr[0].message,
							cancelVal : '确定',
							cancel : function() {
								$(errorArr[0].element).focus();
							}
						});
					} catch (err) {
					}
				},
				//验证规则
				rules : {
					'post[post_title]' : {
						required : 1
					},
					'post[post_content]' : {
						editorcontent : true
					}
				},
				//验证未通过提示消息
				messages : {
					'post[post_title]' : {
						required : '请输入标题'
					},
					'post[post_content]' : {
						editorcontent : '内容不能为空'
					}
				},
				//给未通过验证的元素加效果,闪烁等
				highlight : false,
				//是否在获取焦点时验证
				onfocusout : false,
				//验证通过，提交表单
				submitHandler : function(forms) {
					if (formloading)
						return;
					$(forms).ajaxSubmit({
						url : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
						dataType : 'json',
						beforeSubmit : function(arr, $form, options) {
							formloading = true;
						},
						success : function(data, statusText, xhr, $form) {
							formloading = false;
							if (data.status) {
								setCookie("refersh_time", 1);
								//添加成功
								Wind.use("artDialog", function() {
									art.dialog({
										id : "succeed",
										icon : "succeed",
										fixed : true,
										lock : true,
										background : "#CCCCCC",
										opacity : 0,
										content : data.info,
										button : [ {
											name : '继续添加？',
											callback : function() {
												reloadPage(window);
												return true;
											},
											focus : true
										}, {
											name : '返回列表页',
											callback : function() {
												location = "{:U('AdminPost/index')}";
												return true;
											}
										} ]
									});
								});
							} else {
								artdialog_alert(data.info);
							}
						}
					});
				}
			});
		});
		////-------------------------
	});
</script>
</body>
</html>